﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace RCSP.DataAccess
{
    public class DistrictAccess : RCSPDatabaseAccess
    {
         public DistrictAccess()
        {
        }

         public DistrictAccess(string connectionString)
            : base(connectionString)
        {
        }

         public DataSet GetDistrictByStateCode(string stateCode)
        {
            var command = new SqlCommand
            {
                Connection = Connection,
                CommandType = CommandType.StoredProcedure,
                CommandText = "GetDistrictByStateCode"
            };

            command.Parameters.Add(new SqlParameter("@stateCode", stateCode));
            Connection.Open();
            var adapter = new SqlDataAdapter(command);
            var ds = new DataSet();
            adapter.Fill(ds);
            return ds;
        }
    }
}
